Install Vercel Web Analytics integration - #12
Draft
vercel[bot] wants to merge 1 commit into
Draft
Conversation
Implemented Vercel Web Analytics for Atoms.ninja Project ========================================================== Successfully installed and configured Vercel Web Analytics following the latest official documentation from https://vercel.com/docs/analytics/quickstart Changes Made: ------------- 1. Next.js Application (my-workflow-app/) - Installed @vercel/analytics package (v1.5.0) - Modified my-workflow-app/app/layout.tsx: * Added import: `import { Analytics } from '@vercel/analytics/next';` * Added <Analytics /> component before closing </body> tag - Updated my-workflow-app/package.json and my-workflow-app/package-lock.json 2. Root HTML Application (index.html) - Created analytics.js file with Vercel Analytics injection code - Added script import to index.html: `<script type="module" src="analytics.js"></script>` - Uses the vanilla JS/HTML5 approach with `inject()` function from '@vercel/analytics' Implementation Details: ----------------------- For the Next.js App Router application: - Followed the official Next.js App Router integration pattern - Added the Analytics component to the root layout as per Vercel documentation - Analytics will track page views automatically in the Next.js app For the root HTML application: - Created a separate analytics.js module file (similar to existing speed-insights.js) - Uses the vanilla JavaScript inject() method for HTML5 applications - Script loaded as ES module with type="module" attribute Testing: -------- - ✅ Next.js app builds successfully with no errors - ✅ ESLint passes with no warnings - ✅ TypeScript compilation successful - ✅ All lockfiles properly updated Note: The root package.json already had @vercel/analytics@^1.5.0 installed as a dependency. Verification: ------------- Once deployed to Vercel, analytics can be verified by: 1. Checking browser Network tab for requests to `/<unique-path>/view` 2. Viewing analytics data in Vercel dashboard under the project's Analytics section Both applications are now configured to send analytics data to Vercel when deployed. Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Author
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented Vercel Web Analytics for Atoms.ninja Project
Successfully installed and configured Vercel Web Analytics following the latest official documentation from https://vercel.com/docs/analytics/quickstart
Changes Made:
Next.js Application (my-workflow-app/)
import { Analytics } from '@vercel/analytics/next';Root HTML Application (index.html)
<script type="module" src="analytics.js"></script>inject()function from '@vercel/analytics'Implementation Details:
For the Next.js App Router application:
For the root HTML application:
Testing:
Note: The root package.json already had @vercel/analytics@^1.5.0 installed as a dependency.
Verification:
Once deployed to Vercel, analytics can be verified by:
/<unique-path>/viewBoth applications are now configured to send analytics data to Vercel when deployed.
View Project · Web Analytics
Created by ashwinazer with Vercel Agent